// 引入 react 依赖
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Text, View, Image, TouchableOpacity, ImageBackground, ScrollView } from 'react-native';

// 引入第三方依赖
import _ from 'lodash';
import pureRender from 'pure-render-decorator';
import Icon from 'react-native-vector-icons/Ionicons';

// antd 按需加载
import { } from '@ant-design/react-native';

// 引入 处理数据 所需文件
import { } from './module.js'

// 引入样式
import Styles from './style.js';

// 引入公用组件
import { } from '../../components/index.js'

// 引入工具包
import { press, size, ScreenWidth } from '../../util/utils.js'
class RnCheckoutBox extends Component {
	static propTypes = {

	}

	constructor(props) {
		super(props)
		this.state = {
			value: props.defaultValue || false
		}
	}

	render() {
		const { children, value, defaultValue, onChange } = this.props
		return (
			<TouchableOpacity
				style={{

				}}
				onPress={() => {
					this.setState({
						value: !value
					})
					onChange(!value)
				}}
			>
				<View style={{
					flexDirection: 'row',
					alignItems: 'center',
				}}>
					<Icon name={value ? "md-radio-button-on" : "md-radio-button-off"} size={20} color={'#666'} />
					<View style={{ marginLeft: 10 }}>
						<Text style={{ fontSize: 14, color: '#61676F', lineHeight: 16, }}>{children}</Text>
					</View>
				</View>
			</TouchableOpacity>
		)
	}
}

export default pureRender(RnCheckoutBox)
